<?php
	require("../inc/functions.php");
	require_once("../inc/users.php");
	if(isset($_POST['id'])){
		$row = $_POST;
		SaveUser($row);
		header("Location: index.php");
	}
	else
		$row = GetUser($_REQUEST['id']);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Edit of user <?=$row['FirstName']?> <?=$row['LastName']?></title>
    <link rel="stylesheet" type="text/css" href="../inc/css/bootstrap.css"/>
</head>

<body>

<?php include('../inc/header.php'); ?>
        <div class="container">
        <div>
        	<?php include('../inc/nav.php'); ?>
        </div>

        <form class="form-horizontal" method="POST" action="">
            <div class="control-group">
             <label class="control-label" for="firstName">First Name</label>
             <div class="controls">
                <input type="text" name="firstName" id="firstName" value="<?=$row['FirstName']?>"/>
               </div>
            </div>
                <br />
            <div class="control-group">
             <label class="control-label" for="lastName">Last Name</label>
                 <div class="controls">
                <input type="text" name="lastName" id="lastName" value="<?=$row['LastName']?>"/>
                 </div>
            </div>
            	<br/>
             <div class="control-group">
             <label class="control-label" for="created_at">Created At</label>
                 <div class="controls">
                <input type="text" name="created_at" id="created_at" value="<?=$row['created_at']?>"/>
                 </div>
            </div>
            	<br/>
             <div class="control-group">
             <label class="control-label" for="updated_at">Updated At</label>
                 <div class="controls">
                <input type="text" name="updated_at" id="updated_at" value="<?=$row['updated_at']?>"/>
                 </div>
            </div>
            <br/>
             <div class="control-group">
             <label class="control-label" for="keyword_id">Keyword I.D.</label>
                 <div class="controls">
                <input type="text" name="keyword_id" id="keyword_id" value="<?=$row['Keyword_id']?>"/>
                 </div>
            </div>
            <input type="hidden" name="id" value="<?php $_GET['id'] ?>" />
            <br/>
            <input type="submit" name="submit" value="Submit" class="btn btn-primary btn-large" />
        </form>
</div>
    
    
</body>
</html>